﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;
using System.Data.SqlClient;
namespace DAO
{
   public class DangNhapDAO
    {
       public bool KTDangNhap(string user, string pass, string Quyen)
       {
           string sql = "select * from NguoiDung where TenNguoiDung=N'" + user + "'and MatKhau=N'" + pass + "' and Quyen=N'" + Quyen + "'";
           SqlConnection conn = DataProvider.ConnectDB("QLVCB.mdf");
           SqlCommand cmd = new SqlCommand(sql, conn);
           SqlDataReader dr = cmd.ExecuteReader();
           if (dr.Read())
           {
               conn.Close();
               return true;
           }
           conn.Close();
           return false;
       }
    }
}
